1. Field of the Invention
The present invention relates to an image processing method, and more particularly to an image processing method for obtaining a single clear image by merging a plurality of images with different depths of field.
2. Related Art
The depth of field refers to the range of clear vision in front of and behind the focus when focusing at a point. The depth of field is relevant to the diaphragm, lens, shooting position, and distance to the shot object: the larger the diaphragm is, the shallower the depth of field is, and the smaller the diaphragm is, the deeper the depth of field is; the longer the focal length of the lens is, the shallower the depth of field is, and on the contrary, the shorter the focal length of the lens is, the deeper the depth of field is; and the depth of field is relatively shallow when the distance to the shot object is relatively small, and it is relatively deep when the distance to the shot object is relatively large. Among the above, the most direct and effective manner for adjusting the depth of field is to change the diaphragm. When taking a picture, in order to highlight the person in the picture and to make the surroundings be vague, a larger diaphragm is selected to obtain a shallower depth of field; on the contrary, in order to shoot scenery or building, a smaller diaphragm is selected to obtain a deeper depth of field, so as to make all the sceneries in the front and back become clear.
As the technology for manufacturing digital camera (DC) components is rapidly developed and becomes mature, DC modules are embedded into electronic devices such as mobile phones, personal digital assistants (PDAs), MP3 players and laptop computers, so as to enable users to enjoy taking pictures at anytime and anywhere. As these electronic devices are required to be designed light, thin, short, and small, easy to carry along with, and convenient to operate, the built-in DC modules in most of these electronic devices are designed to have fixed focal length and fixed diaphragm. In order to meet the requirements of shooting near and distant objects, the DC module in certain electronic device drives the lens module of the camera through utilizing physical principles such as electromagnetic forces, so as to adjust the focal length, and thus achieving the multi-stage zooming effect without excessively enlarging the size of the DC module. Currently, the DC modules applied in these portable electronic devices still use fixed diaphragms, that is because, non-fixed diaphragms utilize multi-blade design or motor driving mode in DC modules to control the size of the diaphragm, which occupy larger space than DC modules with fixed diaphragms. However, the users now have higher requirements on the quality of images taken by these electronic devices, and most users expect the DC modules of the electronic devices to break the technical bottleneck of the depth of field, i.e., expect the depth of field to be adjustable, so as to obtain clear images of the foreground or full range. Some solutions are to merge a plurality of images with different focal lengths into a full-range clear image. For example, in PRC Patent Publication No. CN1402191A, an image is divided into a plurality of blocks, and then the image is converted into frequency domains through “discrete wavelet frame”. Then, parts of the blocks are compared to determine whether the block is a clear or vague block. Finally, clear parts of the blocks in two images are selected to be merged to obtain a single clear image. The defects of this method lie in that, a lot of calculation resources are consumed to convert digital images from space domains into frequency domains, and image edges are obviously existed after the images are merged (the image edges are too clear or vague), and thus the images become rather unnatural.